package top.yudoge.dogeeditor.db.api

import top.yudoge.dogeeditor.db.service.KingbaseVendorBridge
import top.yudoge.dogeeditor.db.service.MySQLVendorBridge
import top.yudoge.dogeeditor.db.service.SQLVendorBridge

enum class DataSourceVendorEnum {
    MySQL("MySQL", MySQLVendorBridge()),
    KingBaseOracle("KingBase Oracle", KingbaseVendorBridge()),
    ;

    val vendorName: String
    val bridge: SQLVendorBridge

    constructor(vendorName: String, bridge: SQLVendorBridge) {
        this.vendorName = vendorName
        this.bridge = bridge
    }

    companion object {
        fun byVendorName(vendorName: String): DataSourceVendorEnum? {
            return values().find { it.vendorName == vendorName }
        }
    }
}